/*
 * @Author: your name
 * @Date: 2021-06-21 10:22:56
 * @LastEditTime: 2021-09-27 15:22:05
 * @LastEditors: zhl
 * @Description: In User Settings Edit
 * @FilePath: \dl645\src\serialInterface\SerialInterface.h
 */



#ifndef SERIALINTERFACE_SERIALINTERFACE_H_
#define SERIALINTERFACE_SERIALINTERFACE_H_

#include "SerialEI.h"



class SerialInterface {
private:
	SERIAL_PARAMS c_serial_params;
	std::string   c_addr;


public:
	SerialInterface(std::string addr, SERIAL_PARAMS param);
	SerialInterface();
	~SerialInterface();

	void set_baud_rate(int baud_rate);
	void set_parity_check(std::string parity);
	void set_stop_bit(uint8_t stop_bit);
	void set_data_bits(uint8_t data_bits);
	void set_params(SERIAL_PARAMS param);
	void set_addr(std::string addr);
	int  send_request(uint8_t *buf, int buf_len, int req_id, int priority);
	int  get_request_msg(uint8_t *buf, int buf_len, int req_id, int priority, std::string &msg);

	SERIAL_PARAMS &get_serial_params();
	std::string  get_addr();


private:



	
};

#endif /* SERIALINTERFACE_SERIALINTERFACE_H_ */
